package com.orangecy.rulesubscribe.template;

import com.orangecy.rulesubscribe.RuleEngineResult;
import com.orangecy.rulesubscribe.callback.GeneralActionCallBack;
import com.orangecy.rulesubscribe.context.RuleContext;

/**
 * @Author : orangeCy.奕
 * @Product : 猎豹养成产品源码
 * @Time : 2021/10/22
 * @Desc : 编排抽象模板实现
 */
public class RuleEngineTemplateImpl implements RuleEngineTemplate {

    @Override
    public RuleEngineResult invoke(RuleContext context, GeneralActionCallBack callBack) {
        callBack.valParamContext(context);
        callBack.routerSubscriber(context);
        callBack.mappingSubscribeRules(context);
        callBack.filterSubscribeRules(context);
        callBack.ruleProcessBefore(context);
        callBack.ruleProcess(context);
        callBack.ruleProcessAfter(context);
        return callBack.assemble(context);
    }
}